<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="width=device-width, initial-scale=1.0">
<title>借用管理-修改</title>
<link href="<%=path %>/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/css/select.css" rel="stylesheet" type="text/css" />

<script type="text/javascript"
	src="<%= basePath%>/third/jquery-validation-1.14.0/lib/jquery.js"></script>
<script type="text/javascript"
	src="<%= basePath%>/third/jquery-validation-1.14.0/dist/jquery.validate.js"></script>
<script type="text/javascript"
	src="<%= basePath%>/third/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
<script type="text/javascript" src="<%=path %>/js/select-ui.min.js"></script>
<script type="text/javascript">
        $(function(){
		
			//如果是新增成功，会返回1，如果是1，则提示保存成功
			if("1" == "${actionState}"){
				alert('保存成功！');
			}
			
			$("#commonform").validate({
                errorClass: "errorInfo", //默认为错误的样式类为：error
                focusInvalid: false, //当为false时，验证无效时，没有焦点响应  
                onkeyup: false,   
                submitHandler: function(form){   //表单提交句柄,为一回调函数，带一个参数：form   
					checkFrom();
                    form.submit();   //提交表单   
                },   
                rules:{
               		 "sysBorrow.id":{
                        required:true
                    },
                	"sysBorrow.b_id":{
                		required:true
                	},
                    "sysBorrow.b_number":{
                        required:true
                    },
                    "sysBorrow.b_starttime":{
                        required:true
                    },
                    "sysBorrow.b_endtime":{
                        required:true
                    },
                     "sysBorrow.bstate":{
                        required:true
                    },
                     "sysBorrow.e_id":{
                        required:true
                    },
                     "sysBorrow.ea_id":{
                        required:true
                    },
                     "sysBorrow.bd_id":{
                        required:true
                    },
                    
                },
                messages:{
                	"sysBorrow.id":{
                        required:"必填",
                    },
                	"sysBorrow.b_id":{
                        required:"必填",
                    },
                    "sysBorrow.b_number":{
                        required:"必填",
                    },
                    "sysBorrow.b_starttime":{
                        required:"必填",
                    },
					"sysBorrow.b_endtime":{
                        required:"必填",
                    },
                    "sysBorrow.bstate":{
                        required:"必填",
                    },
                    "sysBorrow.e_id":{
                        required:"必填",
                    },
                    "sysBorrow.ea_id":{
                        required:"必填",
                    },
                    "sysBorrow.bd_id":{
                        required:"必填",

                    },
                  }
            });    
        });

			
</script>


<script type="text/javascript">
	$(document).ready(function(e){
		$(".select2").uedSelect({
			width:155
		});
	});
</script>
</head>
<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
   	<li><a href="#">首页</a></li>
    <li><a href="#">借用与维修管理</a></li>
    <li><a href="#">修改借用信息</a></li>
    </ul>
    </div>
    
    <div class="formbody">
    
    <div class="formtitle"><span>借用基本信息</span></div>
   
   	<form action="<%= basePath%>/biz/SysBorrow_update.action" method="post"  id="commonform">
	<ul class="forminfo">
	
	<li><label>ID序号</label><input name="id" type="text" readonly="ture" class="dfinput" value="${sysBorrow.id}" id="${sysBorrow.id}"/><i><font color="#FF0000">*id不可更改</font></i></li>
		    
    <li><label>借用编号</label><input name="sysBorrow.b_id"  type="text"  class="dfinput" value="${sysBorrow.b_id}" id="${sysBorrow.b_id}" /><i><font color="#FF0000">*必填</font></i></li>
    <li><label>借用数量</label><input name="sysBorrow.b_number"  type="number" class="dfinput" value="${sysBorrow.b_number}" id="${sysBorrow.b_number}" /><i><font color="#FF0000">*必填</font></i></li>
    <li><label>借用日期</label><input name="sysBorrow.b_starttime"  class="flatpickr flatpickr-input" type="text"  readonly="readonly" value="${sysBorrow.b_starttime}" id="${sysBorrow.b_starttime}" /><i><font color="#FF0000">*必填</font></i></li>
   	<li><label>归还日期</label><input name="sysBorrow.b_endtime"   class="flatpickr flatpickr-input" type="text"  readonly="readonly" value="${sysBorrow.b_endtime}" id="${sysBorrow.b_endtime}" /><i><font color="#FF0000">*必填</font></i></li>
   	<li><label>设备编号</label><input name="sysBorrow.e_id"  type="text" class="dfinput" value="${sysBorrow.e_id}" id="${sysBorrow.e_id}" /><i><font color="#FF0000">*必填</font></i></li>
   	<li><label>附件编号</label><input name="sysBorrow.ea_id"  type="text" class="dfinput" value="${sysBorrow.ea_id}" id="${sysBorrow.ea_id}" /><i><font color="#FF0000">*必填</font></i></li>
   	<li><label>部门编号</label><input name="sysBorrow.bd_id"  type="text" class="dfinput" value="${sysBorrow.bd_id}" id="${sysBorrow.bd_id}" /><i><font color="#FF0000">*必填</font></i></li>
   	<li><label><font style="font-weight: #FF0000">借用状态</font></label>
        <label><input class="radio1"  type ="radio" name="sysBorrow.bstate"  value="1" ></input>已归还</label> 
        <label><input class="radio1"  type ="radio" name="sysBorrow.bstate"  value="2"  checked="checked"></input>正在借用</label> 
    </li>
    <li><br/><br/><label>&nbsp;</label><input name="edit_btn" type="submit" class="btn" value="提交"/></li>
   	</ul>
   
	</form>

	</div>

</body>

	<script type="text/javascript">
    	document.getElementsByClassName("myClass").flatpickr({
    		enableTime: true,
    		time_24hr: true,
    	});
    	document.getElementById("b_starttime").flatpickr();
    	document.getElementById("b_endtime").flatpickr();
    </script>
    
</html>
